home *** CD-ROM | disk | FTP | other *** search
-
- $EXP_INCLUDE "form_escape.js"
- $EXP_INCLUDE "updown.js"
- <SCRIPT LANGUAGE="JavaScript">
- <!--
- var sitenames = new Object();
- var urls = new Object();
- var descriptions = new Object();
-
- $EXP_INIT
-
- function selectSource(index) {
- if (sitenames[index] != null)
- {
- document.forms[0].description.value = descriptions[index];
- document.forms[0].url.value = urls[index];
- document.forms[0].sitename.value = sitenames[index];
- }
- }
-
- function clearMe() {
- document.forms[0].description.value = "";
- document.forms[0].url.value = "";
- document.forms[0].sitename.value = "";
- document.forms[0].sitename.focus();
- }
-
- function switchPosition(first, second) {
- tmp_value = document.forms[0].sl.options[second].value;
- tmp_text = document.forms[0].sl.options[second].text;
- document.forms[0].sl.options[second].value = document.forms[0].sl.options[first].value;
- document.forms[0].sl.options[second].text = document.forms[0].sl.options[first].text;
- document.forms[0].sl.options[first].value = tmp_value;
- document.forms[0].sl.options[first].text= tmp_text;
- document.forms[0].sl.selectedIndex = first;
-
- // switch the values
- value = descriptions[second];
- descriptions[second] = descriptions[first];
- descriptions[first] = value;
-
- value = urls[second];
- urls[second] = urls[first];
- urls[first] = value;
-
- value = sitenames[second];
- sitenames[second] = sitenames[first];
- sitenames[first] = value;
- }
-
- var button='apply';
- function handleSubmit() {
- if (button == "removeOp") {
- if (document.forms[0].sl.selectedIndex < 0) {
- alert('Please select a web site first.');
- return false;
- }
- if (!window.confirm('Are you sure you want to delete that site?')){
- return false;
- }
- }
-
- if ((button == "addOp") || (button == "apply") || (button == "ok")) {
- site_name = document.forms[0].sitename.value;
- if ((site_name.length == 0) || (site_name.indexOf(',') != -1)) {
- alert('Name can not be empty or contain commas.');
- return false;
- }
- if (document.forms[0].url.value.length == 0) {
- alert('URL can not be empty.');
- return false;
- }
- }
- param = "";
- for(j=0; j< document.forms[0].sl.options.length; j++) {
- param = param + "&seq=" + formEscape(document.forms[0].sl.options[j].value);
- if (document.forms[0].sl.options[j].selected) {
- param = param + "&sel=" + formEscape(document.forms[0].sl.options[j].value);
- }
- }
-
- param = param + "&catid=" + formEscape(document.forms[0].catid.options[document.forms[0].catid.selectedIndex].value);
- param = param + "&sitename=" + formEscape(document.forms[0].sitename.value);
- param = param + "&url=" + formEscape(document.forms[0].url.value);
- param = param + "&description=" + formEscape(document.forms[0].description.value);
-
- self.location = document.forms[0].action+ "?" + button + "=1" + param;
-
- return false;
- }
- if (isIE3)
- selectSource(0);
- //-->
- </SCRIPT>
-